using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using MishraReader.Entities;

namespace MishraReader
{
    public interface IOptionsManager
    {
        event EventHandler<EventArgs> ActivatedServicesChanged;
        event EventHandler<EventArgs> OnRefreshTick;
        string AccentColorCode { get; set; }

        /// <summary>
        ///   All activated services amoung those available
        /// </summary>
        IEnumerable<ShareServiceAccount> ActivatedServices { get; }

        String Background { get; set; }
        bool BrowserUseThemeColor { get; set; }
        string Login { get; set; }
        bool MarkSelectedItemAsRead { get; set; }
        int MaxItemsByRequest { get; set; }
        bool OrderByPublicationDateDesc { get; set; }
        string Password { get; set; }
        int RefreshFrequency { get; set; }
        bool ShowInTaskbar { get; set; }
        bool ShowOnlyPostSummary { get; set; }
        bool UseNotificationIcon { get; set; }
        
        // These two properties are used by WPF binding but aren't portable
        //  GridLength LeftColumnWidth { get; set; }
        //GridLength MiddleColumnWidth { get; set; }
        
        
        /// <summary>
        ///   Gets the service account associated to the defined service
        /// </summary>
        /// <param name="shareServicePackage"> </param>
        /// <returns> </returns>
        ShareServiceAccount GetServiceAccount(IShareServicePackage shareServicePackage);

        Task Load();
        Task Persist();
        void ReplaceActivatedServices(IEnumerable<ShareServiceAccount> services);
        void UpdateAccentColor();
    }
}